﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Warehouse.DataAccess
{
    public partial class Warehouse : CustomeEntity<Warehouse>
    {
        public WarehouseType HouseType
        {
            get { return (WarehouseType)this.Type; }
            set { this.Type = (int)value; }
        }

        protected override System.Linq.Expressions.Expression<Func<Warehouse, bool>> GetPredicate()
        {
            return p => p.ID == this.ID;
        }

        #region Public Static Methods
        public static Warehouse GetWarehouse(int ID)
        {
            return GetOne(p => p.ID == ID);
        }

        public static Warehouse[] GetWarehouses()
        {
            return GetList().ToArray();
        }
        #endregion
    }

    public enum WarehouseType
    {
        /// <summary>
        /// 未知
        /// </summary>
        Unkown = 0,
        /// <summary>
        /// 虚拟仓库
        /// </summary>
        Virtual = 1,
        /// <summary>
        /// 实体仓库
        /// </summary>
        Entity = 2
    }
}
